package org.wuhong.utils;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;


public class SnowIDUtil {
    private static long workerId=0;
    private static long datacenterId=1;
    private static Snowflake snowflake = IdUtil.createSnowflake(workerId,datacenterId);


    //生成一个有序的时间i
    public static synchronized long snowflakeId(){
        return snowflake.nextId();
    }
}
